#include <stdio.h>
#include <stdlib.h>
#include <glob.h>


#define PAT "*.c"

static int errfunc_(const char *errpath, int eerrno){
	puts(errpath);
	fprintf(stderr,"ERROR MSG:%s\n",strerror(eerrno));
	return 0;
}

int main(){
	glob_t globres;
	int i=0,err=0;
	err=glob(PAT,0,NULL,&globres);
	if(err){
		printf("Error code = %d\n",err)
		exit(1);
	}
	for(i=0;i<globres.gl_pathc;i++){
		puts(globres.gl_pathv[i]);
	}
	exit(0);

}
